//
//  LXC_DataBaseHandle.h
//  12.30_homework_豆瓣电影MVC
//
//  Created by dllo on 16/1/8.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>

@class ActivityModel;

@class MovieModel;

@class ThreeModel;

@class UserModel;

@interface LXC_DataBaseHandle : NSObject
{
    // 创建数据库成员变量
    sqlite3 *dbPoint;
}

@property (nonatomic, assign) BOOL flag;

// 创建单例对象
+ (LXC_DataBaseHandle *)shareDataBaseHandle;
// 打开数据库
- (void)openDBMyActivity;
// 创建表单
- (void)createTab;
// 删除数据库内的表
- (void)deleteTable;
// 删除收藏
- (void)deleteModel:(NSString *)myTitle tabName:(NSString *)tabName;


// 添加用户
- (void)insertModelToUserTab:(UserModel *)model;
// 登陆时候查询用户信息对不对
- (BOOL)selectModelFromUserTab:(UserModel *)model;
// 更新登录状态
- (void)updateModelFromUserTab:(UserModel *)model loginState:(NSInteger)loginState;
// 查询登录状态
- (NSInteger)selectLoginStateFromUserTab:(NSInteger)loginState;
// 查询登录的用户是谁
- (UserModel *)seletLoginUserFromUserTab:(NSInteger)loginState;


// 添加
- (void)insertModelToMovie:(MovieModel *)model;
- (BOOL)selectModelFromMovie:(MovieModel *)model;
- (NSMutableArray *)selectModelFromMovie;
- (void)deletemodelFromMovie:(MovieModel *)model;

// 添加收藏
- (void)insertModel:(ActivityModel *)model;
// 查询是否存在 返回BOOL
- (BOOL)selectModelBool:(ActivityModel *)model;
// 查询所有存在数据库里的元素
- (NSMutableArray *)selectModel;











@end
